<?php
class LoginAction extends Action {
	
	public function index(){
		$admin = session("admin");
		if($admin){	//后台已登录
			redirect(__APP__."/center/frame/main/");
			return;
		}
		$this->display();
	}
	
	//后台登录处理模块
	public function loginProcess(){
		$adminName = $this->_post("admin_name");
		$adminPwd = $this->_post("admin_pwd");
		$result = AdminHelper::checkLogin( $adminName, $adminPwd );
		if ($result != "true") {	//登录失败，提示对应的错误信息
			echo CommonUtil::ajaxReturn(Status::$ERROR,$result);
			return;
		}
		echo CommonUtil::ajaxReturn(Status::$SUCCESS,'验证成功');
	}
	
	
	
}